const Mock = require('mockjs2')
let configArray = []
const files = require.context('./modules', true, /\.js$/)
files.keys().forEach(key => {
	configArray = configArray.concat(files(key).default)
})
// 注册所有的mock服务
configArray.forEach(item => {
	for (let [path, target] of Object.entries(item)) {
		let protocol = path.split('|')
		Mock.mock(new RegExp(protocol[1]), protocol[0], target)
	}
})
Mock.setup({
	timeout: '200-800' // setter delay time
})
